from rest_framework import serializers
from .models import Publisher,Book



class BookSerializer(serializers.ModelSerializer):
    class Meta:
        model = Book
        fields = ['name','book_status','reader','updatetime']

class PublisherSerializer(serializers.ModelSerializer):
    books = BookSerializer(many=True,read_only=True)
    class Meta:
        model = Publisher
        fields = ['name','address','books']








